<template>
  <div class="root">


    <div class="left">

      <div>审核人：{{ tabData2.username }}</div><br><br>
      <div>审核状态：
        <el-tag type="warning" v-if="tableData.is_status === 0">
          {{ tableData.is_status === 0 ? "待初审" : '初审拒绝' }}
        </el-tag>

        <el-tag type="info" v-if="tableData.is_status === 1">
          {{ tableData.is_status === 1 ? "待二审" : '二审拒绝' }}
        </el-tag>

        <el-tag type="info" v-if="tableData.is_status === 3">
          {{ tableData.is_status === 3 ? "待终审" : '终审拒绝' }}
        </el-tag>

        <el-tag type="success" v-if="tableData.is_status === 5">
          {{ tableData.is_status === 5 ? "终审通过" : '终审拒绝' }}
        </el-tag>

        <el-tag type="danger" v-if="tableData.is_status === 6">
          {{ tableData.is_status === 6 ? "终审拒绝" : '终审通过' }}
        </el-tag><br><br>
      </div><br>
      <div>审核时间：{{ tableData.addtime }}</div><br><br>
      <div>来访人：{{ tableData.username }}</div><br><br>
      <div>来访人电话：{{ tableData.mobile }}</div><br><br>
      <div>来访人身份证：{{ tableData.card }}</div><br><br>
      <div>进校目的：{{ tableData.reason }}</div><br><br>
      <div>来访车牌号：{{ tableData.carnumber }}</div><br><br>
      <div>进校时间：{{ tableData.starttime }}</div><br><br>
      <div>出校时间：{{ tableData.endtime }}</div><br><br>


    </div>



    <div class="right">

      <text>行程码:</text>
      <div class="demo-image__preview">
        <el-image style="width: 100px; height: 100px" :src="tableData.travelcode" :initial-index="4"
          fit="cover"></el-image>
      </div>

      <text>健康码:</text>
      <div class="demo-image__preview">
        <el-image style="width: 100px; height: 100px" :src="tableData.healthcode" :initial-index="4"
          fit="cover"></el-image>
      </div>

      <text>核算:</text>
      <div class="demo-image__preview">
        <el-image style="width: 100px; height: 100px" :src="tableData.nucleicacid" :initial-index="4"
          fit="cover"></el-image>
      </div>

      <text>疫苗:</text>
      <div class="demo-image__preview">
        <el-image style="width: 100px; height: 100px" :src="tableData.vaccination" :initial-index="4"
          fit="cover"></el-image>
      </div>


    </div>



  </div>
</template>

<script setup lang='ts'>
import { auditlog } from "../../api/visituser";
import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router';

// 接收跳转过来的参数
const Route = useRoute(); //获取到值
onMounted(() => {
  console.log("获取到的参数", Route.query);  //接收到的参数
})

let tableData: any = ref({})//列表数据
let tabData2: any = ref({})

let geTauditlog = async () => {
  let res: any = await auditlog({ id: Route.query })
  console.log(res);
  tableData.value = res.data.visitor
  tabData2.value = res.data
}
geTauditlog()

</script>

<style scoped lang='less'>
.root {
  display: flex;
  margin-left: 60px;
}

.right {
  margin-left: 80px;
}


// 图片
.demo-image__error .image-slot {
  font-size: 30px;
}

.demo-image__error .image-slot .el-icon {
  font-size: 30px;
}

.demo-image__error .el-image {
  width: 100%;
  height: 200px;
}

.demo-image__preview {
  margin-bottom: 20px;
  margin-top: 6px;
}
</style>